# name: Odoo Method OnChange
# key: odoo_method_onchange
# --
@api.onchange('$1', ...)
def onchange_field(self):
    vals = {}
    # Remove warning if necessary
    vals['warning'] = {
        'title': _('title value')
        'message': _('message value')
    }
    vals['value'] = {
        # 'field1': value1,
        $2
    }
    return vals
